package com.zhongwang.mms.module.half.dao;

import com.zhongwang.mms.gen.entity.BReportPlan;
import com.zhongwang.mms.gen.entity.HChangeOrder;
import com.zhongwang.mms.gen.entity.HChangeOrderExample;
import com.zhongwang.mms.module.half.model.HChangeOrderModel;
import com.zhongwang.mms.module.purchase.model.ChangeOrderQueryModel;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
@Primary
public interface HChangeOrderDao {

    int deleteByExample(HChangeOrderExample example);

    int deleteByPrimaryKey(Integer ceoId);

    int insert(HChangeOrder record);

    int insertSelective(HChangeOrder record);

    int updateByPrimaryKeySelective(HChangeOrder record);

    int updateByPrimaryKey(HChangeOrder record);

    /**查询串料申请表*/
    List<HChangeOrderModel> selectChangeOrderListByQuery(ChangeOrderQueryModel queryModel);

    /**查询当日是否有串料记录*/
    List<HChangeOrder> findAllByDate(Date date);

    /**修改串料*/
    int updateSelective(HChangeOrder hChangeOrder);

    /**根据主键修改状态*/
    int updateStatusByPrimary(HChangeOrder hChangeOrder);

    /**根据主键查询*/
    HChangeOrderModel getAllByPrimary(Integer ceoId);

    /**查询串料执行表*/
    List<HChangeOrderModel> selectChangeOrderExcListByQuery(ChangeOrderQueryModel queryModel);

    /**查询批量串料执行的库存数据*/
    List<HChangeOrderModel> getAllByPrimarys(String ceoIds);

    /**批量更改状态*/
    int updateStatusByPrimarys(String ceoIds);

    /**查询串料信息*/
    HChangeOrderModel getHChangeOrderByCeoId(String ceoId);

    /**根据主键获取计划信息*/
    BReportPlan getBReportPlanPrimaryKey(Integer ceoRppId);

    void updateBReportPlanRppIsFlagByPrimaryKey(BReportPlan bReportPlan);
}